<template>
  <div id="">
    <h2>我是用户界面</h2>
    <p>我是用户</p>
    {{userid}}
    <!-- 也可以不用计算属性，直接拿当前路径 -->
    {{$route.params.userId}}
  </div>
</template>

<script type="text/javascript">
export default {
  name: "User",
  data() {
    return {};
  },
  computed: {
    userid() {
      //第三种路由：拿到当前的路由路径
      return this.$route.params.userId;
    },
  },
  components: {},
};
</script>

<style lang="stylus" scoped></style>
